<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">



<link rel="stylesheet" type="text/css" href="css/wap.css">
<title>注册</title>
</head>
<body class="main">

	<header id="login-head">
    	<div class="login-head-left"><a href="javascript:;" onclick="history.back(-1)"><i></i></a></div>
        <div class="login-head-middle">手机号注册</div>
    </header>
        <form method="post" style="margin-bottom:7.375em;">
            <div class="reg_thetop">
                <span class="col73">1、输入手机号</span> > 2、输入验证码 > 3、设置密码
            </div>
        	<div class="login-form">
                <p class="reg_tip">验证短信已发送至180****000</p>
                <div class="step1">
                   <div class="form-list reg_phone">
                       <div class="form-list-top">
                           <span class="quhao">+86</span>
                           <input type="text" name="text" class="form-input1" onkeyup="checkPhone()" id="phone" placeholder="手机号码 ">
                           <i class="icon-close" style="display:none;"></i>
                       </div>
                   </div>
               </div>
                <div class="step2">
                    <div class="form-list reg_phone">
                        <div class="form-list-top">
                            <input type="text" name="text" class="form-input1"  placeholder="请输入短信验证码">
                            <i class="icon-close" style="display:none;"></i>
                        </div>
                    </div>
                </div>
			</div>
			<div class="form-list-btn">
				<button  name="text" class="form-button"  id="btn-submit" disabled >获取验证码</button>
			</div>
            
        </form>
</body>
</html>
<script type="text/javascript" src="js/jquery.js"></script>
<!--<script type="text/javascript" src="js/login-th.js"></script>-->
<script>

    $(".form-button").click(function () {
        $(".reg_tip").show();
        $(".login-form .reg_phone").css("margin-top","1em")
        $(".form-button").text("提交验证码")
        $(".step1").hide()
        $(".step2").show()
        $("#btn-submit").css("color","#ffc595");
        return  false;
        
    })
    function checkPhone() {

            // checkSubmit();
            var phone = $("#phone").val();
            /^(1)\d{10}$/
            if( phone.match(/^(1)\d{10}$/)){
                return true;
            }else{
                return false;
            }

    }
    $(function() {
        $(".icon-close").hide();
        $(".form-input1").keyup(function() {
            var res=checkPhone();
            var phone_val = $(this).val();
            if ( phone_val == ""){
                $(this).parent().find(".icon-close").hide();
            }else if (phone_val !== ""&& res){

                $("#btn-submit").css("color","#fff");
                $("#btn-submit").attr("disabled",false);
            }else{
                $(this).parent().find(".icon-close").show();
            }
        });
        $(".icon-close").click(function () {
            $(this).parent().find('input').val('');
            $(this).hide();
        })
    });
</script>